package com.sfchen.cloud.controller;

import com.sfchen.cloud.utils.JsonData;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class HelloController {

    @Value("${server.port:8091}")
    private int port;

    @GetMapping(value = {"/"})
    public JsonData<Map> hello() {
        return JsonData.buildSuccess(Map.of("name", "db-server", "port", port));
    }

}
